package com.wwtech.epp.ui.activity.work.module;

import com.wwtech.epp.data.api.HttpAPIWrapper;
import com.wwtech.epp.entity.appmessage.AppMessage;
import com.wwtech.epp.ui.activity.base.ActivityScope;
import com.wwtech.epp.ui.activity.work.WorkMessageActivity;
import com.wwtech.epp.ui.activity.work.contract.WorkMessageContract;
import com.wwtech.epp.ui.activity.work.presenter.WorkMessagePresenter;
import com.wwtech.epp.ui.adapter.work.AppMessageAdapter;
import com.wwtech.epp.ui.adapter.work.PolymerizationMessageAdapter;

import java.util.ArrayList;

import dagger.Module;
import dagger.Provides;

/**
 * @author hzp
 * @Package com.wwtech.epp.ui.activity.work
 * @Description: The moduele of WorkMessageActivity, provide field for WorkMessageActivity
 * @date 2017/10/16 21:23:25
 */
@Module
public class WorkMessageModule {
    private final WorkMessageContract.View mView;


    public WorkMessageModule(WorkMessageContract.View view) {
        this.mView = view;
    }

    @Provides
    @ActivityScope
    public WorkMessagePresenter provideWorkMessagePresenter(HttpAPIWrapper httpAPIWrapper, WorkMessageActivity mActivity) {
        return new WorkMessagePresenter(httpAPIWrapper, mView, mActivity);
    }

    @Provides
    @ActivityScope
    public WorkMessageActivity provideWorkMessageActivity() {
        return (WorkMessageActivity) mView;
    }

    @Provides
    @ActivityScope
    public PolymerizationMessageAdapter providePolymerizationMessageAdapter() {
        return new PolymerizationMessageAdapter(new ArrayList<ArrayList<AppMessage>>());
    }
    @Provides
    @ActivityScope
    public AppMessageAdapter provideAppMessageAdapter() {
        return new AppMessageAdapter(new ArrayList<AppMessage>());
    }
}